import * as React from "react";
import { useLocalStore } from "mobx-react-lite";
import { getDetaultStore } from "../models/index";

export const storeContext = React.createContext<any>(null);

export const StoreProvider: any = ({ children }: any) => {
  const store = useLocalStore(getDetaultStore);
  return (
    <storeContext.Provider value={store}>{children}</storeContext.Provider>
  );
};

export default StoreProvider;
